home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / ZSI / wstools / UserTuple.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  3KB  |  90 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4.  
  5. class UserTuple:
  6.     
  7.     def __init__(self, inittuple = None):
  8.         self.data = ()
  9.         if inittuple is not None:
  10.             if type(inittuple) == type(self.data):
  11.                 self.data = inittuple
  12.             elif isinstance(inittuple, UserTuple):
  13.                 self.data = inittuple.data[:]
  14.             else:
  15.                 self.data = tuple(inittuple)
  16.         
  17.  
  18.     
  19.     def __repr__(self):
  20.         return repr(self.data)
  21.  
  22.     
  23.     def __lt__(self, other):
  24.         return self.data < self._UserTuple__cast(other)
  25.  
  26.     
  27.     def __le__(self, other):
  28.         return self.data <= self._UserTuple__cast(other)
  29.  
  30.     
  31.     def __eq__(self, other):
  32.         return self.data == self._UserTuple__cast(other)
  33.  
  34.     
  35.     def __ne__(self, other):
  36.         return self.data != self._UserTuple__cast(other)
  37.  
  38.     
  39.     def __gt__(self, other):
  40.         return self.data > self._UserTuple__cast(other)
  41.  
  42.     
  43.     def __ge__(self, other):
  44.         return self.data >= self._UserTuple__cast(other)
  45.  
  46.     
  47.     def __cast(self, other):
  48.         if isinstance(other, UserTuple):
  49.             return other.data
  50.         else:
  51.             return other
  52.  
  53.     
  54.     def __cmp__(self, other):
  55.         return cmp(self.data, self._UserTuple__cast(other))
  56.  
  57.     
  58.     def __contains__(self, item):
  59.         return item in self.data
  60.  
  61.     
  62.     def __len__(self):
  63.         return len(self.data)
  64.  
  65.     
  66.     def __getitem__(self, i):
  67.         return self.data[i]
  68.  
  69.     
  70.     def __getslice__(self, i, j):
  71.         i = max(i, 0)
  72.         j = max(j, 0)
  73.         return self.__class__(self.data[i:j])
  74.  
  75.     
  76.     def __add__(self, other):
  77.         if isinstance(other, UserTuple):
  78.             return self.__class__(self.data + other.data)
  79.         elif isinstance(other, type(self.data)):
  80.             return self.__class__(self.data + other)
  81.         else:
  82.             return self.__class__(self.data + tuple(other))
  83.  
  84.     
  85.     def __mul__(self, n):
  86.         return self.__class__(self.data * n)
  87.  
  88.     __rmul__ = __mul__
  89.  
  90.